/**
 * 
 */
package root.board;

import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;

/**
 * @author Calebe
 * 
 */
public abstract class Piece implements PieceInterface {
	public static final int SOUTH = 0;
	public static final int NORTH = 1;
	public static int ID = 0;

	public static void main(String[] args) {
		Class<Piece> classe = Piece.class;
		Method[] metodos = classe.getMethods();
		for (Method method : metodos) {
			if (method.getModifiers() == Modifier.PUBLIC)
				System.out.println("-" + method.getName() + "():" + method.getReturnType());
		}
		System.out.println();
		Field[] fields = classe.getDeclaredFields();
		for (Field field : fields) {
			System.out.println("-" + field.getName() + ":" + field.getType().getName());
		}
	}

	private final int pieceId;

	private int team;

	/**
	 * 
	 */
	public Piece() {
		pieceId = Piece.ID++;
		setTeam(NORTH);
	}

	public Piece(int team) {
		pieceId = Piece.ID++;
		setTeam(team);
	}

	/**
	 * @return the pieceId
	 */
	public int getPieceId() {
		return pieceId;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see root.board.PieceInterface#getTeam()
	 */
	@Override
	public int getTeam() {
		return team;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see root.board.PieceInterface#setTeam(int)
	 */
	@Override
	public void setTeam(int team) {
		this.team = team;
	}
}
